<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>用户管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/back/css/x-admin.css"
	media="all">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/back/css/pag.css" media="all">
</head>
<body>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a><cite>首页</cite></a> <a><cite>用户管理</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="layui-icon" style="line-height: 30px">ဂ</i></a>
	</div>
	<div class="x-body">
		<form class="layui-form x-center" action="" style="width: 85%">
			<div class="layui-form-pane">
				<div class="layui-form-item">
				
				</div>
			</div>
		</form>
		<div class="tools">
			<ul class="toolbar">
			
			<span class="x-right" style="line-height: 25px">共有数据：2 条</span>
			</xblock>
		</div>
		<table class="tablelist">
			<thead>
				<tr>
					<th><input onclick="selectAll()" type="checkbox"
						name="controlAll" style="" id="controlAll"></th>
					<th>ID</th>
					<th>用户名</th>
					<th>性别</th>
					<th>年龄</th>
					<th>电话</th>
					<th>名族</th>
					<th>地址</th>
					<th>身份证</th>
					<th>病人亲属</th>
					<th>病人亲属电话</th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${patient==null }">
					<jsp:forward page="${pageContext.request.contextPath}/getPatient"></jsp:forward>
				</c:if>
				<c:forEach items="${patient}" var="p">
					<tr>
						<td><input type="checkbox" value="1" name="selected">
						</td>
						<td>${p.patientid}</td>
						<td>${p.patientname}</td>
						<td>${p.patientsex}</td>
						<td>${p.patientage}</td>
						<td>${p.patienttel}</td>
						<td>${p.patientnation}</td>
						<td>${p.patientaddress}</td>
						<td>${p.patientidentity}</td>
						<td>${p.patientrelationname}</td>
						<td>${p.patientrelationtel}</td>
					</tr>
				</c:forEach>


			</tbody>
		</table>
		<div class="page" v-show="show">
			<div class="pagelist">
				<span class="jump">上一页</span> <span class="jump">1</span> <span
					
					class="jump">下一页</span> <span class="jumppoint">跳转到：</span> <span
					class="jumpinp"> <input type="text">
				</span> <span class="jump gobtn">GO</span>
			</div>
		</div>
	</div>
	<br />
	<br />
	<br />
	<script
		src="${pageContext.request.contextPath}/back/lib/layui/layui.js"
		charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/back/js/x-layui.js"
		charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/back/js/jquery2.js"
		charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/back/js/js.js"
		charset="utf-8"></script>
	<script>
		layui.use([ 'laydate', 'element', 'laypage', 'layer' ], function() {
			$ = layui.jquery;//jquery
			lement = layui.element();//面包导航
			laypage = layui.laypage;//分页
			layer = layui.layer;//弹出层

		});

		/*用户-添加*/
		function user_management_add(title, url, w, h) {
			x_admin_show(title, url, w, h);
		}
		/*用户-查看*/
		function user_management_show(title, url, id, w, h) {
			x_admin_show(title, url, w, h);
		}

		/*用户-停用*/
		function member_stop(obj, id) {
			layer
					.confirm(
							'确认要停用吗？',
							function(index) {
								//发异步把用户状态进行更改
								$(obj)
										.parents("tr")
										.find(".td-manage")
										.prepend(
												'<a style="text-decoration:none" onClick="member_start(this,id)" href="javascript:;" title="启用"><i class="layui-icon">&#xe62f;</i></a>');
								$(obj).parents("tr").find(".td-status").html(
										'<button class="sp3">已停用</button>');
								$(obj).remove();
								layer.msg('已停用!', {
									icon : 5,
									time : 1000
								});
							});
		}

		/*用户-启用*/
		function member_start(obj, id) {
			layer
					.confirm(
							'确认要启用吗？',
							function(index) {
								//发异步把用户状态进行更改
								$(obj)
										.parents("tr")
										.find(".td-manage")
										.prepend(
												'<a style="text-decoration:none" onClick="member_stop(this,id)" href="javascript:;" title="停用"><i class="layui-icon">&#xe601;</i></a>');
								$(obj).parents("tr").find(".td-status").html(
										'<button class="sp">已启用</button>');
								$(obj).remove();
								layer.msg('已启用!', {
									icon : 6,
									time : 1000
								});
							});
		}
		// 用户-编辑
		function user_management_edit(title, url, id, w, h) {
			x_admin_show(title, url, w, h);
		}
		/*密码-修改*/
		function user_management_password(title, url, id, w, h) {
			x_admin_show(title, url, w, h);
		}

		$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>